<script>
import { requestPost } from '@/api/system/common'

export default {
  name: 'ColumnDialogEntity',
  data() {
    return {
      dialogVisible: false,
      form: {
        x: 0,
        y: 0,
        w: 6,
        h: 8,
        layoutId: '',
        zd: 0
      }
    }
  },
  methods: {
    openDialog(data) {
      this.form.layoutId = data
      this.dialogVisible = true
    },
    closeDialog() {
      this.dialogVisible = false
      this.$emit('fetch-data')
    },
    saveObject() {
      requestPost('rest/api/sys/livebos/v1/column/save/entity', this.form).then(() => {
        this.closeDialog()
      })
    }
  }
}
</script>

<template>
  <el-dialog
    :show-close="false"
    append-to-body
    :visible.sync="dialogVisible"
    width="400px"
    hight="300px"
  >
    <div slot="title" class="custom-header">
      显示层设置
    </div>
    <div class="custom-body">
      <el-input-number value="form.zd" />
    </div>
    <div slot="footer" class="custom-footer">
      <el-button type="primary" @click="closeDialog">取消</el-button>
      <el-button type="primary" @click="saveObject">保存</el-button>
    </div></el-dialog>
</template>

<style scoped>
.custom-header {
  font-weight: bold;
  height: 40px;
  padding: 0 20px;
  display: flex;
  align-items: center;
}
::v-deep .el-input-number--small {
  width: 100%;
}
</style>
